Support cel::ActivationInterface in CelTestContext. - #2182
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_956029155
branch
from
July 29, 2026 19:38
6422d3c to
4822c45
Compare
copybara-service
Bot
force-pushed
the
test_956029155
branch
6 times, most recently
from
July 29, 2026 20:03
13885a7 to
8207d52
Compare
Update `CelTestContext` and `CelActivationFactoryFn` to return `std::unique_ptr<cel::ActivationInterface>` instead of `cel::Activation` by value. Previously, `CelTestContext::CelActivationFactoryFn` was hardcoded to return `absl::StatusOr<cel::Activation>`. This overlooked the fact that `cel::Runtime::Evaluate` accepts `const cel::ActivationInterface&` and prevents custom or lazy activations that implement `cel::ActivationInterface` directly from being returned by the factory without object slicing or compilation errors. `CelTestContext` and `TestRunner` now accept `std::unique_ptr<cel::ActivationInterface>` from the factory function. PiperOrigin-RevId: 956045618
copybara-service
Bot
force-pushed
the
test_956029155
branch
from
July 29, 2026 20:08
8207d52 to
54c0512
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support cel::ActivationInterface in CelTestContext.
Update
CelTestContextandCelActivationFactoryFnto returnstd::unique_ptr<cel::ActivationInterface>instead ofcel::Activationby value.Previously,
CelTestContext::CelActivationFactoryFnwas hardcoded to returnabsl::StatusOr<cel::Activation>. This overlooked the fact thatcel::Runtime::Evaluateacceptsconst cel::ActivationInterface&and prevents custom or lazy activations that implementcel::ActivationInterfacedirectly from being returned by the factory without object slicing or compilation errors.CelTestContextandTestRunnernow acceptstd::unique_ptr<cel::ActivationInterface>from the factory function.